package com.atguigu.gulimall.order.service;

import com.atguigu.common.to.mq.SeckillOrdetInfoTo;
import com.atguigu.gulimall.order.vo.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.order.entity.OrderEntity;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * ????
 *
 * @author wuyijun
 * @email 983665697@qq.com
 * @date 2021-11-29 13:21:39
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 订单确认页要返回的数据
     * @return
     */
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    /**
     * 下单 生成订单
     * @param orderSubmitVo
     * @return
     */
    SubmitOrderResponseVo submitOrder(OrderSubmitVo orderSubmitVo);

    OrderEntity getOrderInfoByOrderSn(String orderSn);

    void closeOrder(OrderEntity entity);

    /**
     * 获取支付界面的信息
     * @param orderSn
     * @return
     */
    PayVo getPayVoByOrderSn(String orderSn);

    /**
     * 订单页面获取所有的订单项
     * @param params
     * @return
     */
    PageUtils queryPageWithItems(Map<String, Object> params);

    /**
     * 在支付宝支付完成后,修改订单状态以及新增支付流水
     * @param payAsyncVo
     * @return
     */
    String handlePayResult(PayAsyncVo payAsyncVo);

    void createSeckillOrder(SeckillOrdetInfoTo seckillEntity) throws ExecutionException, InterruptedException;
}

